﻿@model ElectrodomesticosAbr2014.Models.Chango
@{
    ViewBag.Title = "Index";
}


<style>
    .text-right {
        text-align: right;
    }
</style>
<h2>Index</h2>

<a href="@Url.Action("Index", "Home")">Volver al Home</a>

<table>
    <thead>
        <tr>
            <th>Nombre</th>
            <th>Cantidad</th>
            <th>Precio unitario</th>
            <th>Total</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.Items)
        {
        <tr>
            <td>@item.producto.Nombre</td>
            <td style="text-align: right;" class="text-right">@String.Format("{0:0}", @item.cantidad)</td>
            <td class="text-right">@String.Format("{0:c}", @item.producto.Precio)</td>
            <td class="text-right">@String.Format("{0:c}", item.Total())</td>
        </tr>
        }
    </tbody>
    <tfoot>
        <tr>
            <th colspan="3">Total: </th>
            <th class="text-right">@String.Format("{0:c}", @Model.Total())</th>
        </tr>
    </tfoot>

</table>
